﻿using System;
using System.Web.Mvc;
using Sharp.Infrastructure;
using Sharp.Platform.Configuration;
using Sharp.WebBooter.Areas.Platform;

namespace Sharp.WebBooter.Areas.CMS.Controllers
{
    public class SettingController : Controller
    {

        public ActionResult Index()
        {
            var model = SystemConfigManage.Read<CMSInfoConfig>();
            return View(model);
        }

        [HttpPost]
        public ActionResult Save(PlatformInfo vm)
        {
            if (vm == null)
            {
                Json(new Result() { Err = "提交数据出错。" });
            }

            SystemConfigManage.Save(vm);
            return this.JsonNet(new Result());
        }
        
    }
}